import request from '@/utils/request'

const api = {
  verifyPerformance: '/api/incentive/configVerify',
  searchPerformance: '/api/incentive/search',
  evaluatePerformance: '/api/incentive/evaluate',
  allocatePerformance: '/api/incentive/allocate', // 绩效分配
  generaterformance: '/api/incentive/generate', // 绩效生成
  getRelatedVersions: '/api/incentive/related', // .查询已关联绩效参数年份版本
  deleteAllocate: '/api/incentive/delAllocate', // 绩效删除
  initialPerformance: '/api/incentive/initial'
}

export default api
// getRelatedVersions

export function deleteAllocate (parameter) {
  return request({
    url: api.deleteAllocate,
    method: 'post',
    config: 'x-www-form-urlencoded',
    params: parameter
  })
}

export function getRelatedVersions (parameter) {
  return request({
    url: api.getRelatedVersions,
    method: 'post',
    config: 'x-www-form-urlencoded',
    params: parameter
  })
}

export function initialPerformance (parameter) {
  return request({
    url: api.initialPerformance,
    method: 'post',
    config: 'x-www-form-urlencoded',
    params: parameter
  })
}

export function verifyPerformance (parameter) {
  return request({
    url: api.verifyPerformance,
    method: 'post',
    config: 'x-www-form-urlencoded',
    params: parameter
  })
}

export function searchPerformance (parameter) {
  return request({
    url: api.searchPerformance,
    method: 'post',
    config: 'x-www-form-urlencoded',
    params: parameter
  })
}
export function evaluatePerformance (parameter) {
  return request({
    url: api.evaluatePerformance,
    method: 'post',
    config: 'x-www-form-urlencoded',
    // config: 'json',
    // headers: { 'Content-Type': 'application/json' },
    params: parameter
  })
}
export function allocatePerformance (parameter) {
  return request({
    url: api.allocatePerformance,
    method: 'post',
    config: 'x-www-form-urlencoded',
    params: parameter
  })
}
export function generaterformance (parameter) {
  return request({
    url: api.generaterformance,
    method: 'post',
    config: 'x-www-form-urlencoded',
    params: parameter
  })
}
// 查询已关联绩效参数年份版本
export function related (parameter) {
  return request({
    url: api.generaterformance,
    method: 'post',
    config: 'x-www-form-urlencoded',
    params: parameter
  })
}
